﻿@model IEnumerable<ExpertSMS.Models.FoodProduct>
           @{
               ExpertSMS.Models.Food food = Model.FirstOrDefault().Food;
           }
<table>
    <tr>
        <th>สินค้า</th>
        <th>จำนวน</th>
        <th>หน่วย</th>
        <th></th>
    </tr>
    @foreach (var item in Model)
    {
        <tr>
            <td>
                @Html.ActionLink(item.Product.Name,"Details","Products",new{id=item.ProductID},null)
            </td>
            <td class="right">@item.Quantity.ToString("n2")</td>
            <td>@item.Unit.Name</td>
            
                <td>[ @Ajax.ActionLink("ลบ", "DeleteConfirmed", "FoodProducts", new { id = item.FoodProductID },
                new AjaxOptions { LoadingElementId = "loading", HttpMethod = "Get", UpdateTargetId = "productlist" }, null) ]</td>
            
        </tr>
    }
</table>
<br />
<div id="productdetails">
                @Html.Partial("_FoodProductDetails", food.FoodID)
                </div>